package com.game.service;

import com.game.service.app.Utils;
import com.game.service.define.RoomConfig;

import java.util.Arrays;
import java.util.Collections;

public class Test {
    public static void main(String[] args) {
        String code = String.format("UID=%s@LUCKY_VALUE=%s@KEY=%s", 10086, 9000, RoomConfig.LUCKY_KEY);
        String sign = Utils.encryptMD5(code);
        System.out.println(sign);
        Long [] list = new Long[100];

        for (int i = 0; i < 100; i++) {
            list[i] = testGame();
        }
        Arrays.sort(list, Collections.reverseOrder());
        System.out.println("Sorted array in descending order: " + Arrays.toString(list));
    }

    private static long testGame() {
        long total = 0;
        for (int i = 0; i < 20; i++) {
            int a1 = Utils.random(1, 6);
            int a2 = Utils.random(1, 6);
            int a3 = Utils.random(1, 6);
            int a = a1 + a2 + a3;
            total += a;
        }
        System.out.println(total);
        return total;
    }
}
